// document.addEventListener("DOMContentLoaded", function() {
//     // 显示全屏提示
//     showFullScreenPrompt();
// });

export function showFullScreenPrompt() {
    const promptDiv = document.createElement('div');
    promptDiv.innerHTML = `
        <div style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); color: white; display: flex; align-items: center; justify-content: center; z-index: 1000;">
            <div style="text-align: center;">
                <p>点击以进入全屏模式</p>
                <button id="fullscreenPromptBtn" style="padding: 10px 20px; font-size: 16px;">进入全屏</button>
            </div>
        </div>
    `;
    document.body.appendChild(promptDiv);

    document.getElementById("fullscreenPromptBtn").addEventListener("click", function() {
        enterFullScreen();
        document.body.removeChild(promptDiv); // 移除提示
    });
}

export function enterFullScreen() {
    let element = document.documentElement; // 获取整个网页

    if (element.requestFullscreen) {
        element.requestFullscreen();
    } else if (element.mozRequestFullScreen) { // Firefox
        element.mozRequestFullScreen();
    } else if (element.webkitRequestFullscreen) { // Chrome, Safari 和 Opera
        element.webkitRequestFullscreen();
    } else if (element.msRequestFullscreen) { // IE/Edge
        element.msRequestFullscreen();
    }
}

 // 退出全屏模式
 export function exitFullScreen() {
    if (document.exitFullscreen) {
        document.exitFullscreen();
    } else if (document.mozCancelFullScreen) { // Firefox
        document.mozCancelFullScreen();
    } else if (document.webkitExitFullscreen) { // Chrome, Safari 和 Opera
        document.webkitExitFullscreen();
    } else if (document.msExitFullscreen) { // IE/Edge
        document.msExitFullscreen();
    }
}